<?php
namespace app\admin\controller;
use think\Controller;
use think\Request;
use think\Db;
/**
 * 
 * @author 时
 * @description 分布获取章节地区版本 节
 * @package app\admin\controller
 *
 */
class Alunm extends Controller
{
    /*
     * 下一步保存session
     */
    public function session_save()
    {
        $title=input('post.title');
        $courseware_introduce=input('post.courseware_introduce');
        $curriculum_time=input('post.curriculum_time');
        $status=input('post.status');
        $end_time=input('post.end_time');
        $fee=input('post.fee');
        $data=array('title'=>$title,'courseware_introduce'=>$courseware_introduce,
            
            'curriculum_time'=>$curriculum_time,'status'=>$status,
            'end_time'=>$end_time,'fee'=>$fee
        );
       
        session('info',$data);
       
        $this->redirect("admin/Alunm/subject_select");
    }
    //地区查询查询数据库pid=0 的数据id进行保存到
   public function subject_select()
   {
      if(Request::instance()->isGet()){
          $pid=0;
          $res=Db::table("category")->field(array('type_name','node_id'))->where('parent_id',$pid)->select();
          if(isset($res)){
              $this->assign('data',$res);
              return view('subject');
          }
         $_GET['extra'];
      }else {
         $node_id=input('post.node_id');
       $this->redirect('admin/Alunm/are_select',['id'=>$node_id]);
      }
   }
   /**
    * 
    * @param 科目 $id 
    * @return mixed 地区id
    */
   public function are_select($id){
      
     if(Request::instance()->isGet()){
         $where=array();
         Db::table('category')->field('type_name','node_id')->where($where)->select();
         return view();
     }
   }
   public function node_select()
   {
       
   }
}